<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>All Contracts</title>
</head>
<script type="text/javascript">
function confirmDelete()
{

	var result = confirm("Are you sure you want to delete this contract ?");
	var r;
	if(result)
	{
		r = document.getElementsByName("hiddenText");
		r[0].value=1;
		alert(r[0].value);
		
	}else
	{
		 r = document.getElementsByName("hiddenText");
		r[0].value=-1;
		alert(r[0].value);
	}
	return r;

}

</script>
<body>
#{list items:conList, as:'Contract'}
<form action="@{Contracts.delete(Contract.id)}" >
	<ul>
		
		
		<li><a href="@{Contracts.showProducts(Contract.id)}">${Contract.contract_id}
		</a>
		</li>
		<a href="@{Contracts.edit(Contract.id)}">Edit</a>
		
		<a href="@{Contracts.delete(Contract.id)}" onclick="confirmDelete()">Delete</a> 
	
	</ul>
	<input type="hidden" name="hiddenText"/>
	
	
	</form>
		#{/list}

</body>
</html>